package cn.edu.nju.oraldefense.action;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class LogoutAction extends ActionSupport {

	private boolean success = false;

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String deanExecute() {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().remove("dean");
		success = true;
		return SUCCESS;
	}
	
	public String teacherExecute() {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().remove("teacher");
		success = true;
		return SUCCESS;
	}
	
	public String graduateExecute() {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().remove("graduate");
		success = true;
		return SUCCESS;
	}
	
	public String observerExecute() {
		ActionContext ctx = ActionContext.getContext();
		ctx.getSession().remove("observer");
		success = true;
		return SUCCESS;
	}
}
